package com.ch999.mobileoa.data;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.sda.lib.util.Logs;

/**
 * Created by scorpio on 15/12/25.
 */
public class Result {

    private int stats ;
    private String msg ;
    private String data ;

    public static Result parse(Object response) {
        JSONObject json = JSON.parseObject(response.toString());
        Logs.Debug("response=="+response.toString());
        Result result = new Result(json.getInteger("stats"),json.getString("msg"),json.getString("data"));
        return result;
    }

    public Result(int stats,String msg,String data){
        setStats(stats);
        setMsg(msg);
        setData(data);
    }

    public boolean isSucc(){
        if (stats ==1){
            return true ;
        }else{
            return false ;
        }
    }

    public int getStats() {
        return stats;
    }

    public void setStats(int stats) {
        this.stats = stats;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }
}
